package com.eco
{
	import com.eco.*;
	import com.framework.*;
	
	import flash.display.MovieClip;
	import flash.events.*;
	import flash.utils.*;
	
	//冲击波道具
	public class BonusBlast extends Bonus
	{
		public function BonusBlast()
		{
			super( 8, Bonus.BONUS_BLAST);
			
			//iExistTime = 10001;
			iFunctionTime = 0;//瞬发
		}
		
		override public function StartFunction():void
		{
			if( ftFighter == null || vecEnemy == null )
				return;
			
			CreateSoundEvent( CustomEventSound.PLAY_SOUND, SoundInfo.EFF_BONUS_BLAST_ACTIVE);
			
			var i:int = 0;
			for( i=0; i<vecEnemy.length; i++)
			{
				vecEnemy[i].v2dSpeed.x = vecEnemy[i].x - ftFighter.x;
				vecEnemy[i].v2dSpeed.y = vecEnemy[i].y - ftFighter.y;
				vecEnemy[i].v2dSpeed.setLength(2);
				vecEnemy[i].x += (vecEnemy[i].x - ftFighter.x)/4;
				vecEnemy[i].y += (vecEnemy[i].y - ftFighter.y)/4;
			}
			
			super.StartFunction();
		}
	}
}